26IL

Technical details

Show code
library(GeoPressureR)
library(leaflet)
library(leaflet.extras)
library(raster)
library(dplyr)
library(ggplot2)
library(kableExtra)
library(plotly)
library(GeoLocTools)
setupGeolocation()
knitr::opts_chunk$set(echo = FALSE)
load(paste0("../data/1_pressure/", params$gdl_id, "_pressure_prob.Rdata"))
load(paste0("../data/2_light/", params$gdl_id, "_light_prob.Rdata"))
load(paste0("../data/3_static/", params$gdl_id, "_static_prob.Rdata"))
load(paste0("../data/4_basic_graph/", params$gdl_id, "_basic_graph.Rdata"))
load(paste0("../data/5_wind_graph/", params$gdl_id, "_wind_graph.Rdata"))
col <- rep(RColorBrewer::brewer.pal(8, "Dark2"), times = ceiling(max(pam$sta$sta_id) / 8))

Settings used

All the results produced here are generated with (1) the raw geolocator data, (2) the labeled files of pressure and light and (3) the parameters listed below.

Show code
kable(gpr) %>% scroll_box(width = "100%")
gdl_id keep crop_start crop_end thr_dur extent_N extent_W extent_S extent_E map_scale map_max_sample map_margin prob_map_s prob_map_s_calib prob_map_thr shift_k kernel_adjust calib_lon calib_lat calib_1_start calib_1_end calib_2_start calib_2_end calib_2_lon calib_2_lat prob_light_w thr_prob_percentile thr_gs thr_as RingNo scientific_name common_name mass wing_span Color sta_id_winter
26IL 9 2020-07-14 2021-06-30 0 51 -18 5 16 4 300 30 1 1.3 0.9 0 1.4 8.70603 46.5492 2020-07-14 2020-09-11 2021-05-08 2021-06-30 NA NA 0.09 0.95 120 100 N566945 Oenanthe oenanthe Northern wheatear NA NA #EF553B 14

Pressure timeserie

The labeling of pressure data is illustrated with this figure. The black dots indicates the pressure datapoint not considered in the matching. Each stationary period is illustrated by a different colored line.

Show code
pressure_na <- pam$pressure %>%
  mutate(obs = ifelse(isoutlier | sta_id == 0, NA, obs))
p <- ggplot() +
  geom_line(data = pam$pressure, aes(x = date, y = obs), colour = "grey") +
  # geom_point(data = subset(pam$pressure, isoutlier), aes(x = date, y = obs), colour = "black") +
  # geom_line(data = pressure_na, aes(x = date, y = obs, color = factor(sta_id)), size = 0.5) +
  geom_line(data = do.call("rbind", shortest_path_timeserie) %>% filter(sta_id > 0), aes(x = date, y = pressure0, col = factor(sta_id))) +
  theme_bw() +
  scale_colour_manual(values = col) +
  scale_y_continuous(name = "Pressure(hPa)")

ggplotly(p, dynamicTicks = T) %>% layout(showlegend = F)

Pressure calibration

Show code
pressure_ts_bind <- do.call("rbind", shortest_path_timeserie) %>%
  filter(!is.na(sta_id))

pam$pressure %>%
  left_join(pressure_ts_bind %>% dplyr::select(c("date", "pressure0")), by = "date") %>%
  mutate(diff = ifelse(is.na(pressure0), 0, obs - pressure0)) %>%
  filter(sta_id > 0 & !isoutlier) %>%
  group_by(sta_id) %>%
  mutate(sta_id = paste0(sta_id, " (SD=", round(sd(diff), 2), " ; N=", n(), ")")) %>%
  ggplot(aes(x = diff)) +
  geom_histogram(aes(y = (..count..) / tapply(..count.., ..PANEL.., sum)[..PANEL..]), binwidth = .2) +
  facet_wrap(~sta_id) +
  scale_x_continuous(name = "Pressure Geolocator - best match ERA5 (hPa)") +
  scale_y_continuous(name = "Normalized histogram")

Light

Show code
raw_geolight <- pam$light %>%
  transmute(
    Date = date,
    Light = obs
  )
lightImage(tagdata = raw_geolight, offset = 0)
tsimagePoints(twl$twilight,
  offset = 0, pch = 16, cex = 1.2,
  col = ifelse(twl$deleted, "grey20", ifelse(twl$rise, "firebrick", "cornflowerblue"))
)
abline(v = gpr$calib_2_start, lty = 1, col = "firebrick", lwd = 1.5)
abline(v = gpr$calib_1_start, lty = 1, col = "firebrick", lwd = 1.5)
abline(v = gpr$calib_2_end, lty = 2, col = "firebrick", lwd = 1.5)
abline(v = gpr$calib_1_end, lty = 2, col = "firebrick", lwd = 1.5)

Show code
hist(z, freq = F)
lines(fit_z, col = "red")

The probability map resulting from light data alone can be seen below.

Show code
li_s <- list()
l <- leaflet(width = "100%") %>%
  addProviderTiles(providers$Stamen.TerrainBackground) %>%
  addFullscreenControl()
for (i_r in seq_len(length(light_prob))) {
  i_s <- metadata(light_prob[[i_r]])$sta_id
  info <- pam$sta[pam$sta$sta_id == i_s, ]
  info_str <- paste0(i_s, " | ", info$start, "->", info$end)
  li_s <- append(li_s, info_str)
  l <- l %>% addRasterImage(light_prob[[i_r]], opacity = 0.8, colors = "OrRd", group = info_str)
}
l %>%
  addCircles(lng = gpr$calib_lon, lat = gpr$calib_lat, color = "black", opacity = 1) %>%
  addLayersControl(
    overlayGroups = li_s,
    options = layersControlOptions(collapsed = FALSE)
  ) %>%
  hideGroup(tail(li_s, length(li_s) - 1))

Light vs Pressure

We can compare light and pressure location at long stationary stopover (>5 days). By assuming the best match of the pressure to be the truth, we can plot the histogram of the zenith angle and compare to the fit of kernel density at the calibration site.

Show code
 raw_geolight <- pam$light %>%
    transmute(
      Date = date,
      Light = obs
    )
 dur <- unlist(lapply(pressure_prob, function(x) difftime(metadata(x)$temporal_extent[2],metadata(x)$temporal_extent[1], units = "days" )))
  long_id <- which(dur>5)

  par(mfrow = c(2, 3))
  for (i_s in long_id){
    twl_fl <- twl %>%
      filter(!deleted) %>%
      filter(twilight>shortest_path_timeserie[[i_s]]$date[1] & twilight<tail(shortest_path_timeserie[[i_s]]$date,1))
    sun <-  solar(twl_fl$twilight)
    z_i <- refracted(zenith(sun, shortest_path_timeserie[[i_s]]$lon[1], shortest_path_timeserie[[i_s]]$lat[1]))
    hist(z_i, freq = F, main = paste0("sta_id=",i_s, " | ",nrow(twl_fl),"twls"))
    lines(fit_z, col = "red")
    xlab("Zenith angle")
  }

Similarly, we can plot the line of sunrise/sunset at the best match of pressure (yellow line) and compare to the raw and labeled light data.

Show code
  lightImage(
    tagdata = raw_geolight,
    offset = gpr$shift_k / 60 / 60
  )
  tsimagePoints(twl$twilight,
                offset = gpr$shift_k / 60 / 60, pch = 16, cex = 1.2,
                col = ifelse(twl$deleted, "grey20", ifelse(twl$rise, "firebrick", "cornflowerblue"))
  )
  for (ts in shortest_path_timeserie){
    twl_fl <- twl %>%
      filter(twilight>ts$date[1] & twilight<tail(ts$date,1))
    if (nrow(twl_fl)>0){
    tsimageDeploymentLines(twl_fl$twilight,
                           lon = ts$lon[1], ts$lat[1],
                           offset = gpr$shift_k / 60 / 60, lwd = 3,col = adjustcolor("orange", alpha.f = 0.5))
      
    }
  }

Stationay period information

Show code
read_csv(paste0("../reports/figure_print/table_transition/transition_", params$gdl_id, ".csv")) %>% kable() %>% scroll_box(width = "100%")
…1 sta_id_s sta_id_t flight_duration as_m as_s gs_m gs_s ws_m ws_s dist_m dist_s ws_m_support ws_m_drift start_flight end_flight sunrise sunset as_sp gs_sp ws_sp dist_sp ws_sp_support ws_sp_drift alt_min alt_max alt_mean alt_med alt_sumdabsdiff alt_sumposdiff gdl_id
1 1 2 4.5 45.12684 7.699357 47.59807 8.924990 7.306054 1.8742216 214.19132 40.16245 2.9678015 6.676120 2020-09-10 18:30:00 2020-09-10 23:00:00 2020-09-11 04:35:55 2020-09-10 18:17:04 42.95123 45.191001 6.198175 203.35951 2.6093231 5.6221714 2611.02252 4387.7198 3423.8121 3346.2346 3.797248e+03 2255.7744888 26IL
2 2 3 2.0 35.13200 16.944640 35.49125 16.706746 4.661648 1.9628818 70.98250 33.41349 0.6635775 4.614177 2020-09-11 18:00:00 2020-09-11 20:00:00 2020-09-12 04:37:45 2020-09-11 18:19:08 28.07729 27.782334 3.752254 55.56467 -0.0431338 3.7520056 2401.30535 3460.9959 3018.0717 3144.4415 1.593267e+03 533.5763162 26IL
3 3 4 6.0 94.20691 4.926342 99.68582 4.758000 15.774468 1.6132538 598.11494 28.54800 6.5764395 14.338211 2020-09-12 18:00:00 2020-09-13 00:00:00 2020-09-13 04:39:23 2020-09-12 18:16:37 97.05710 103.269581 14.871402 619.61748 7.0963959 13.0690385 222.78219 3763.2314 1941.3909 1584.4365 5.262030e+03 1413.8544764 26IL
4 4 5 3.5 85.18337 9.875898 100.53283 9.597204 17.644566 1.0702466 351.86489 33.59022 15.7260744 8.001331 2020-09-13 19:00:00 2020-09-13 22:30:00 2020-09-14 04:49:28 2020-09-13 18:04:28 81.46064 97.702727 17.985151 341.95954 16.5474037 7.0462098 62.39886 1681.2252 1065.9077 1066.2195 3.112430e+03 2032.0246912 26IL
5 5 6 12.0 37.34174 10.731390 65.01571 9.047854 41.184975 2.3353028 780.18858 108.57425 34.8288058 21.980819 2020-09-25 17:30:00 2020-09-26 05:30:00 2020-09-26 05:05:32 2020-09-25 17:51:06 39.65199 72.284204 41.908423 867.41045 37.4151017 18.8792509 230.53934 2421.5464 845.7293 756.0839 7.064001e+03 3210.8762344 26IL
6 6 7 12.0 51.22079 19.893162 61.85445 19.740763 13.866949 2.9803719 742.25343 236.88915 11.2740185 8.073957 2020-09-26 17:30:00 2020-09-27 05:30:00 2020-09-27 05:13:24 2020-09-26 17:53:23 35.67458 46.209731 14.419071 554.51677 11.5838525 8.5862667 311.16417 2894.3226 1223.6625 770.2077 6.966603e+03 3581.1964183 26IL
7 7 8 11.5 53.42417 19.447018 45.33577 18.707780 14.038087 4.1383844 521.36138 215.13948 -6.6365027 12.370316 2020-09-27 18:00:00 2020-09-28 05:30:00 2020-09-28 05:13:45 2020-09-27 17:58:56 46.47545 40.920954 14.221542 470.59097 -3.4602207 13.7941704 408.44626 4530.1083 2311.9055 1993.0802 1.048085e+04 5217.2122547 26IL
8 8 9 6.0 31.80557 15.777779 42.96682 18.765532 21.013885 3.3562772 257.80091 112.59319 14.8502583 14.867858 2020-09-28 19:30:00 2020-09-29 01:30:00 2020-09-29 05:20:54 2020-09-28 17:57:58 25.70336 38.403896 17.420912 230.42337 14.5517127 9.5778825 403.09012 3832.0067 1603.1387 1420.3153 7.227556e+03 3629.4639193 26IL
9 9 10 4.5 34.15655 14.789111 52.35748 18.674858 25.927844 4.6756423 235.60864 84.03686 21.4571859 14.554803 2020-09-29 20:30:00 2020-09-30 01:00:00 2020-09-30 05:29:01 2020-09-29 18:04:10 26.57687 50.553917 27.403024 227.49263 25.7180281 9.4609078 295.82028 1010.2604 776.1838 910.8920 2.454095e+03 1171.4754585 26IL
10 10 11 3.0 31.62360 16.625351 30.00403 17.167722 19.104229 1.9164207 90.01208 51.50317 4.4187556 18.586182 2020-09-30 21:00:00 2020-10-01 00:00:00 2020-10-01 05:29:09 2020-09-30 18:11:24 26.09332 9.222896 21.109630 27.66869 -8.1418706 19.4763039 244.80495 2275.3752 1263.6565 1161.1450 4.032587e+03 2002.0171669 26IL
11 11 12 2.0 53.67868 18.006617 45.69394 21.854695 26.590964 1.6142130 91.38788 43.70939 -0.9452600 26.574158 2020-10-01 23:30:00 2020-10-02 01:30:00 2020-10-02 05:32:21 2020-10-01 18:10:38 42.81084 42.159192 25.315215 84.31838 6.9437930 24.3442779 243.39175 1581.3703 692.5199 404.8812 2.666883e+03 1337.9785136 26IL
12 12 13 1.5 38.08684 17.199775 39.13299 18.128744 4.073313 2.2656539 58.69948 27.19312 1.2441520 3.878655 2020-10-05 19:00:00 2020-10-05 20:30:00 2020-10-06 05:35:03 2020-10-05 18:10:26 30.50455 35.375515 6.933875 53.06327 5.2151638 4.5695399 242.62245 1614.1480 803.2752 678.1653 2.690868e+03 1371.5255265 26IL
13 13 14 1.0 33.49898 15.085294 42.22259 21.691864 27.621195 0.8933315 42.22259 21.69186 16.8570419 21.880827 2020-10-12 10:00:00 2020-10-12 11:00:00 2020-10-12 05:37:14 2020-10-11 18:07:57 23.37225 26.531642 28.463887 26.53164 18.2397052 21.8519114 248.20466 249.0924 248.5006 248.2047 8.877791e-01 0.8877791 26IL
14 14 15 8.5 32.23714 11.202116 31.30342 10.390311 16.625083 4.5700670 266.07907 88.31764 3.4670983 16.259539 2021-03-21 18:30:00 2021-03-22 03:00:00 2021-03-22 05:37:59 2021-03-21 18:39:22 27.24955 32.381274 19.482007 275.24083 10.5857078 16.3551641 237.84127 2429.8638 1660.5846 1845.8967 5.911561e+03 3038.5067879 26IL
15 15 16 10.0 28.14609 12.509322 44.38172 19.073759 45.345213 6.0074208 443.81717 190.73759 36.4307958 26.999731 2021-03-22 18:30:00 2021-03-23 04:30:00 2021-03-23 05:28:58 2021-03-22 18:30:51 26.35666 22.606111 48.427168 226.06111 47.8090463 7.7126946 384.20835 5147.8907 3446.1291 3306.6213 1.219558e+04 6203.8245658 26IL
16 16 17 6.5 30.50453 12.633950 32.06253 18.070610 25.310632 3.4697304 208.40646 117.45896 11.5104422 22.541912 2021-03-23 18:00:00 2021-03-24 00:30:00 2021-03-24 05:32:01 2021-03-23 18:23:17 26.33055 16.677430 24.968177 108.40330 6.2434364 24.1749743 566.86240 1024.1657 742.6747 711.0141 2.491505e+03 1210.0969654 26IL
17 17 18 7.5 38.32701 15.095112 60.05750 16.354917 33.268972 3.6666602 450.43125 122.66188 27.0138452 19.418462 2021-03-24 18:30:00 2021-03-25 02:00:00 2021-03-25 05:42:35 2021-03-24 18:27:38 26.66967 44.477531 34.960908 333.58148 27.9831716 20.9572714 299.45156 825.4899 620.9416 618.4195 1.698015e+03 700.3692787 26IL
18 18 19 2.5 31.55260 14.211586 35.34981 16.722978 14.971902 2.4362543 88.37453 41.80745 6.7638364 13.356960 2021-03-25 23:00:00 2021-03-26 01:30:00 2021-03-26 05:42:00 2021-03-25 18:38:26 26.14501 33.204120 14.594859 83.01030 9.5163171 11.0656951 266.80720 1557.3163 864.4505 758.7155 4.717633e+03 2378.2148754 26IL
19 19 20 19.0 34.47635 10.314468 46.57863 13.367300 23.843151 8.5833947 884.99401 253.97870 16.6325858 17.083704 2021-04-04 18:30:00 2021-04-05 13:30:00 2021-04-05 05:15:25 2021-04-04 18:40:20 32.31311 49.864257 32.879961 947.42088 25.3026791 20.9968151 233.71401 3800.0737 1815.5431 1306.6843 1.033126e+04 5218.5616728 26IL
20 20 21 11.0 30.52391 11.942926 36.30105 13.218733 14.293712 6.8679621 399.31158 145.40606 8.1315453 11.755347 2021-04-05 18:30:00 2021-04-06 05:30:00 2021-04-06 05:18:39 2021-04-05 18:33:13 30.18107 36.330827 7.283679 399.63910 6.3593933 3.5510706 243.51023 2690.9202 1796.0888 2009.9493 7.360204e+03 3636.9179884 26IL
21 21 22 11.0 45.07262 13.075139 72.74487 13.072703 33.591963 5.7160034 800.19356 143.79973 30.1649774 14.781546 2021-04-08 18:30:00 2021-04-09 05:30:00 2021-04-09 05:04:18 2021-04-08 18:44:41 29.94167 56.477208 33.467214 621.24929 30.2177280 14.3855240 248.02299 3450.7274 2280.8495 2339.0131 8.201982e+03 4570.9650450 26IL
22 22 23 1.5 34.77391 15.675047 49.25761 24.711618 34.782635 3.9474155 73.88641 37.06743 24.6349648 24.555044 2021-04-09 21:30:00 2021-04-09 23:00:00 2021-04-10 05:04:20 2021-04-09 18:46:19 30.20194 47.976299 29.244080 71.96445 23.3947239 17.5471690 1135.18311 2323.0432 1707.6330 1686.1528 2.292724e+03 1104.8643193 26IL
23 23 24 1.5 33.35247 16.038846 34.15071 17.093765 19.318669 2.1071288 51.22607 25.64065 6.2530862 18.278673 2021-04-11 23:30:00 2021-04-12 01:00:00 2021-04-12 05:00:16 2021-04-11 18:50:36 30.00011 23.945136 19.138617 35.91770 0.8279265 19.1207012 1016.68546 1769.6671 1386.2205 1379.2648 1.455037e+03 752.9816328 26IL
24 24 25 13.0 46.77860 15.985980 50.65283 15.346765 13.224389 2.2639938 658.48683 199.50794 5.4523734 12.048074 2021-04-23 19:00:00 2021-04-24 08:00:00 2021-04-24 04:37:19 2021-04-23 19:00:21 27.52238 32.012814 12.281785 416.16658 6.5314678 10.4010658 142.43321 2561.7290 1665.0934 1785.5989 8.560394e+03 3776.1119153 26IL
25 25 26 9.5 35.22614 16.518789 47.20874 18.599922 17.399100 5.1395163 448.48300 176.69925 13.6681526 10.766164 2021-04-24 19:00:00 2021-04-25 04:30:00 2021-04-25 04:21:37 2021-04-24 19:08:36 24.53766 41.070270 16.543103 390.16757 16.5368344 0.4553737 69.03776 3401.6966 1890.7808 1705.8434 1.077716e+04 5386.5717627 26IL
26 26 28 12.5 19.53331 9.656026 22.50134 11.748562 15.598667 7.5812435 281.26675 146.85702 8.1790324 13.282388 2021-04-25 19:00:00 2021-04-26 01:30:00 2021-04-26 04:01:00 2021-04-25 19:10:04 26.48852 28.893838 27.087730 361.17298 15.0024605 22.5537424 NA NA NA NA NA NA 26IL
27 28 31 11.5 12.86087 5.199985 18.38594 7.545220 11.162948 2.2372422 211.43826 86.77003 8.0836775 7.698414 2021-05-03 17:00:00 2021-05-04 02:00:00 2021-05-04 03:32:05 2021-05-03 19:09:08 14.25841 24.706092 13.091103 284.12006 11.7069428 5.8587099 NA NA NA NA NA NA 26IL
28 31 32 1.5 39.88277 14.228051 34.74703 14.596728 6.771646 2.1530288 52.12054 21.89509 -4.8554383 4.720160 2021-05-05 23:00:00 2021-05-06 00:30:00 2021-05-06 03:40:13 2021-05-05 19:14:47 28.53769 18.526034 10.021336 27.78905 -10.0064192 0.5465787 1330.77282 1991.9270 1728.3621 1795.3743 1.413017e+03 1037.0853895 26IL
29 32 33 0.5 37.73646 15.640609 39.19387 24.704418 14.221762 3.2692795 19.59694 12.35221 4.0105472 13.644560 2021-05-06 13:00:00 2021-05-06 13:30:00 2021-05-07 03:40:26 2021-05-06 19:16:55 41.48032 55.580542 14.144056 27.79027 14.1113578 0.9611980 1415.41112 2014.2232 1714.8171 1714.8171 5.988120e+02 0.0000000 26IL
30 33 34 1.0 29.90859 16.679628 27.30164 16.981306 5.408673 1.0162178 27.30164 16.98131 -2.1956594 4.942957 2021-05-07 18:30:00 2021-05-07 19:30:00 2021-05-08 03:50:45 2021-05-07 19:16:33 20.25416 19.146616 5.206797 19.14662 -0.4315993 5.1888780 1491.49389 2056.3858 1686.4042 1511.3331 5.648919e+02 564.8919071 26IL